<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="ajile/com.iskitz.ajile.js?mvcoff,mvcshareoff,refresh"></script>
<script type="text/javascript" src="org.wattdepot.gdata.GDataLoader.js"></script>
<script type="text/javascript" src="org.wattdepot.gdata.kukuicup.Configuration.js"></script>
<script type="text/javascript" src="org.wattdepot.gdata.makahiki.EnergyLastSevenDays.js"></script>
</head>

<body>
  <div id="visualization"></div>
</body>

 
<script type="text/javascript">
// Wrap this code in an anonymous self-invoking function to avoid polluting global namespace.
(function() {
  var configuration = new org.wattdepot.gdata.kukuicup.Configuration();
 
  // The next two variables, source and percentageReductionGoal, must be set by Makahiki.
  var source = configuration.ilima_3_4;
  var percentageReductionGoal = 10;

  // Get the spreadsheets we need.
  var rollingDaysEnergyUrl = configuration.getRollingDaysEnergyUrl();
  var refreshInterval = 0; // don't refresh this spreadsheet.

  // Load the visualization API and the spreadsheet, then call displayEnergy.
  var loader = new org.wattdepot.gdata.GDataLoader(displayEnergy, rollingDaysEnergyUrl, refreshInterval);  

  function displayEnergy(rollingDaysDatatable) {
    var energyChart = new org.wattdepot.gdata.makahiki.EnergyLastSevenDays(configuration);
    var datatable = energyChart.makeDataTable(rollingDaysDatatable, source, percentageReductionGoal);
    energyChart.draw('visualization', source, percentageReductionGoal, datatable);
  }
})();
</script>

</html>








